﻿namespace Sai.Core
{
	using System.Reflection;

	/// <summary>
	/// Used to identify the name, version etc of the application generating
	/// the report files.
	/// </summary>
	internal class ApplicationVersionStamp
	{
		/// <summary>
		/// Default constructor.
		/// </summary>
		public ApplicationVersionStamp()
		{
			AssemblyName reflected = Assembly.GetExecutingAssembly().GetName();

			const int FirstThreeLetters = 3;
			this.Name = reflected.Name.Substring(0, FirstThreeLetters);
			this.Link = string.Format("http://{0}.codeplex.com", this.Name);
			this.Version = reflected.Version.ToString();
		}

		/// <summary>
		/// Product name
		/// </summary>
		public string Name
		{
			get;
			private set;
		}

		/// <summary>
		/// Url for the product's web page.
		/// </summary>
		public string Link
		{
			get;
			private set;
		}

		/// <summary>
		/// The current version of the product.
		/// </summary>
		public string Version
		{
			get;
			private set;
		}
	}
}
